package atomic;

import java.util.concurrent.atomic.AtomicStampedReference;

public class AtomicStampedReferenceTest {

    public static void main(String[] args) {
        AtomicStampedReference<Integer> atomic = new AtomicStampedReference<>(0, 1);

        int stamp = atomic.getStamp();

        Integer reference = atomic.getReference();

        boolean result = atomic.compareAndSet(reference, reference + 1, stamp, stamp + 1);
    }
}
